#!/usr/bin/env python3

def isbouncy(num):
    if num < 100:
        return False
    else:
        n = str(num)
        x = 1
        while x < len(n):
            if n[x] != n[x-1]:
                break
            x += 1
        if x == len(n):
            return False
        b = int(n[x]) < int(n[x-1])
        for i in range(x,len(n)):
            if (int(n[i]) > int(n[i-1])) == b and int(n[i]) != int(n[i-1]):
                return True
        return False
b = 0
t = 100

while True:
    if isbouncy(t):
        b += 1
    t += 1
print(t-1)
print(b)